<template>
  <div class="app-container">
    <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="120px" size="small">
      <el-form-item label="订单号" prop="code">
        <el-input v-model="queryParams.code" clearable placeholder="请输入订单号" @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="客户单号" prop="relateBill2">
        <el-input v-model="queryParams.relateBill2" clearable placeholder="请输入客户单号"
                  @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="客户名称" prop="customerName">
        <el-input v-model="queryParams.customerName" clearable placeholder="请输入客户名称"
                  @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="收货人" prop="receivingPerson">
        <el-input v-model="queryParams.receivingPerson" clearable placeholder="请输入收货人"
                  @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="目的网点" prop="jcToOrganizationId">
        <el-select v-model="queryParams.jcToOrganizationId" clearable filterable placeholder="请选择目的网点">
          <el-option v-for="dict in dict.type.DB_JC_ORG" :key="dict.value" :label="dict.label" :value="dict.value"/>
        </el-select>
      </el-form-item>
      <el-form-item label="是否签收" prop="toServerZoneIdDtLabel">
        <el-select v-model="queryParams.isSign" clearable placeholder="请选择是否签收">
          <el-option v-for="dict in dict.type.CommIsNot" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/>
        </el-select>
      </el-form-item>
      <el-form-item label="订单日期">
        <el-date-picker v-model="queryParams.daterangeTime" style="width: 240px" value-format="yyyy-MM-dd"
                        type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
      </el-form-item>

      <el-form-item>
        <el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        <el-button icon="el-icon-more" size="mini" type="success" @click="moreFilterQuery">更多查询</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button v-hasPermi="['order:led:sign']" :disabled="multiple" icon="el-icon-plus" plain size="mini"
                   type="primary"
                   @click="handleSign">签收
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="ledList" @selection-change="handleSelectionChange" :height="tableMaxHeight">
      <el-table-column align="center" type="selection" width="55"/>
      <el-table-column align="left" fixed label="订单" width='160'>
        <template #default="scope">
          <div>{{ scope.row.code }}</div>
          <div>{{ scope.row.fromOrganizationName }} -> {{ scope.row.toOrganizationName }}</div>
          <div>订单日期:{{ parseTime(scope.row.time, '{y}-{m}-{d}') }}</div>
          <dict-tag :options="dict.type.OrderStatus" :value="scope.row.status"/>
        </template>
      </el-table-column>
      <el-table-column align="left" label="单号" prop="relateBill1" width='200'>
        <template #default="scope">
          <div>发货单号:{{ scope.row.relateBill1 }}</div>
          <div>客户单号:{{ scope.row.relateBill2 }}</div>
          <div>运单号:{{ scope.row.shipmentCode }}</div>
        </template>
      </el-table-column>
      <el-table-column align="left" label="运单" prop="shipmentCode" width='200'>
        <template #default="scope">
          <div>运单:{{ scope.row.shipmentCode }}</div>
          <div>司机：{{ scope.row.driverName }}</div>
          <div>电话：{{ scope.row.driverIphone }}</div>
        </template>
      </el-table-column>
      <el-table-column align="left" label="客户" prop="customerName" width='180'>
        <template #default="scope">
          <div>客户:{{ scope.row.customerName }}</div>
          <div>
            是否超期:
            <dict-tag :options="dict.type.CommIsNot" :value="scope.row.customerIsExceed" style="display: inline-block"/>
          </div>
        </template>
      </el-table-column>
      <el-table-column align="left" label="发货人" prop="senderPartyName" show-overflow-tooltip width='200'>
        <template #default="scope">
          <div>发货单位:{{ scope.row.senderPartyName }}</div>
          <div>发货:{{ scope.row.senderPerson }}</div>
          <div>发货电话:{{ scope.row.senderPhone }}</div>
        </template>
      </el-table-column>
      <el-table-column align="left" label="收货人" prop="receivingPartyName" show-overflow-tooltip width='200'>
        <template #default="scope">
          <div>收货单位:{{ scope.row.receivingPartyName }}</div>
          <div>收货人:{{ scope.row.receivingPerson }}</div>
          <div>电话:{{ scope.row.receivingPhone }}</div>
          <div>地址：{{ scope.row.receivingAddress }}</div>
        </template>
      </el-table-column>
      <el-table-column align="left" label="订单时间" prop="factLeaveTime" width='180'>
        <template #default="scope">
          <div v-if="scope.row.factLeaveTime">实际发运时间:{{
              parseTime(scope.row.factLeaveTime, '{y}-{m}-{d} {h}:{i}')
            }}
          </div>
          <div v-if="scope.row.factArriveTime">
            实际到达时间:{{ parseTime(scope.row.factArriveTime, '{y}-{m}-{d} {h}:{i}') }}
          </div>
          <div v-if="scope.row.planLeaveTime">要求发运时间: {{
              parseTime(scope.row.planLeaveTime, '{y}-{m}-{d} {h}:{i}')
            }}
          </div>
          <div v-if="scope.row.planArriveTime">要求到达时间:
            {{ parseTime(scope.row.planArriveTime, '{y}-{m}-{d} {h}:{i}') }}
          </div>
        </template>
      </el-table-column>
      <el-table-column align="left" label="交付" prop="handoverType" width='150'>
        <template #default="scope">
          <div>
            交付方式
            <dict-tag :options="dict.type.HandoverType" :value="scope.row.handoverType" style="display: inline-block"/>
          </div>
          <div>
            是否回单:
            <dict-tag :options="dict.type.CommIsNot" :value="scope.row.isBack" style="display: inline-block"/>
          </div>
          <div v-if="scope.row.isBack === 1">回单份数: {{ scope.row.backNumber }}</div>
          <div>
            运输性质
            <dict-tag :options="dict.type.TransportPro" :value="scope.row.transportPro" style="display: inline-block"/>
          </div>
        </template>
      </el-table-column>
      <el-table-column align="left" label="计数" prop="number" width='100'>
        <template #default="scope">
          <div>件数(件):{{ scope.row.number }}</div>
          <div>体积(平方):{{ scope.row.volume }}</div>
          <div>重量(kg):{{ scope.row.weight }}</div>
        </template>
      </el-table-column>
      <el-table-column align="left" fixed="right" label="签收" prop="qsTime" width='200'>
        <template #default="scope">
          <div>签收时间:{{ scope.row.qsTime ? parseTime(scope.row.qsTime, '{y}-{m}-{d} {h}:{i}') : '--' }}</div>
          <div>签收人:{{ scope.row.qsPerson || '--' }}</div>
          <div class="mt10">
            <el-button size="mini" type="primary" @click="openTrack(scope.row)">在途跟踪</el-button>
          </div>
          <div class="mt10">
            <el-button v-if="scope.row.qsImgs" size="mini" type="primary" @click="openPic(scope.row)">查看签收单
            </el-button>
          </div>
        </template>
      </el-table-column>
      <el-table-column align="center" label="创建时间" prop="createTime" width='100'/>
      <el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作" width='120'>
        <template #default="scope">
          <el-button v-if="!scope.row.qsTime" v-hasPermi="['order:led:sign']" icon="el-icon-edit" size="mini"
                     type="text"
                     @click="handleSign(scope.row)">签收
          </el-button>
          <el-button icon="el-icon-tickets" size="mini" type="text" @click="handleDetail(scope.row)">详情</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum" :total="total"
                 @pagination="getList"/>

    <!-- 添加或修改分段订单对话框 -->
    <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" append-to-body width="900px">
      <el-form ref="qsForm" :model="qsForm" :rules="rules" label-width="120px">
        <el-form-item label="签收分段订单" prop="codes">
          <el-input v-model="qsForm.codes" disabled/>
        </el-form-item>
        <el-form-item label="签收单图片" prop="qsImgs">
          <image-upload v-model="qsForm.qsImgs"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog :close-on-click-modal="false" :visible.sync="orderTrackVisible" append-to-body title="订单追踪"
               width="700px">
      <div class="block" style="max-height: 600px; overflow-y: scroll;">
        <el-timeline>
          <el-timeline-item v-for="(item, index) in orderTrackList" :key="index" :timestamp="item.time" placement="top">
            <el-card>
              <h4>{{ item.event }}</h4>
              <p>{{ item.createName }} 提交于 {{ item.time }}</p>
              <div v-if="item.imgUrls">
                <el-image v-for="(img, ind) in item.imgUrls" :key="ind" style="width: 100px; height: 100px;margin: 10px 10px;" :src="img" :preview-src-list="item.imgUrls"/>
              </div>
            </el-card>
          </el-timeline-item>
        </el-timeline>
      </div>
    </el-dialog>

    <el-dialog title="查看图片" :visible.sync="openPicVisible" width="800px" append-to-body>
      <el-image v-for="(pic, index) in openPicList" :src="pic" style="height: 100px;margin: 20px 20px;" :preview-src-list="openPicList" />
    </el-dialog>

    <el-dialog :visible.sync="openDetail" append-to-body title="详情" width="1000px">
      <el-form ref="detailForm" :model="detailForm" label-width="120px">
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="分段订单" prop="code">
              <el-input v-model="detailForm.code" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="发货单号" prop="relateBill1">
              <el-input v-model="detailForm.relateBill1" placeholder="请输入客户单号1" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="客户单号" prop="relateBill2">
              <el-input v-model="detailForm.relateBill2" placeholder="请输入客户单号2" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="订单日期" prop="time">
              <el-date-picker clearable
                              v-model="detailForm.time"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="请选择订单日期"
                              style="width: 95%;">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="是否回单" prop="isBack">
              <el-select clearable filterable v-model="detailForm.isBack" placeholder="请选择是否回单" disabled>
                <el-option v-for="dict in dict.type.CommIsNot" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8" v-if="detailForm.backNumber != 0">
            <el-form-item label="回单份数" prop="backNumber">
              <el-input v-model="detailForm.backNumber" placeholder="请输入回单份数" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="客户名称" prop="customerName">
              <el-input v-model="detailForm.customerName" placeholder="请输入客户名称" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="实际到达时间" prop="factArriveTime">
              <el-date-picker clearable
                              v-model="detailForm.factArriveTime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              style="width: 95%;"
                              placeholder="请选择实际到达时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="实际发运时间" prop="factLeaveTime">
              <el-date-picker clearable
                              v-model="detailForm.factLeaveTime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              style="width: 95%;"
                              placeholder="请选择实际发运时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="货品件数" prop="number">
              <el-input v-model="detailForm.number" placeholder="请输入件数" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="总金额" prop="value">
              <el-input v-model="detailForm.value" placeholder="请输入总金额" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="总体积" prop="volume">
              <el-input v-model="detailForm.volume" placeholder="请输入总体积" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="总重量" prop="weight">
              <el-input v-model="detailForm.weight" placeholder="请输入总重量" readonly="readonly" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="运单" prop="shipmentCode">
              <el-input v-model="detailForm.shipmentCode" placeholder="请输入运单ID" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="出发网点" prop="fromOrganizationName">
              <el-input v-model="detailForm.fromOrganizationName" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="目的网点" prop="toOrganizationName">
              <el-input v-model="detailForm.toOrganizationName" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="司机姓名" prop="driverName">
              <el-input v-model="detailForm.driverName" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="司机电话" prop="driverIphone">
              <el-input v-model="detailForm.driverIphone" readonly="readonly" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
<!--          senderPartyName-->
          <el-col :span="8">
            <el-form-item label="发货单位" prop="senderPartyName">
              <el-input v-model="detailForm.senderPartyName" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="发货人" prop="senderPerson">
              <el-input v-model="detailForm.senderPerson" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="发货电话" prop="senderPhone">
              <el-input v-model="detailForm.senderPhone" readonly="readonly" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
<!--          receivingPartyName-->
          <el-col :span="8">
            <el-form-item label="收货单位" prop="receivingPartyName">
              <el-input v-model="detailForm.receivingPartyName" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="收货人" prop="receivingPerson">
              <el-input v-model="detailForm.receivingPerson" readonly="readonly" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="收货电话" prop="receivingPhone">
              <el-input v-model="detailForm.receivingPhone" readonly="readonly" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="签收时间" prop="qsTime">
              <el-date-picker clearable
                              v-model="detailForm.qsTime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="请选择签收时间"
                              style="width: 95%;">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="签收人" prop="qsPerson">
              <el-input v-model="detailForm.qsPerson" placeholder="请输入签收人" readonly="readonly" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <el-footer>
        <el-button type="primary" @click="openDetail=false">关闭</el-button>
      </el-footer>
    </el-dialog>


    <more-query ref="moreQuery" :query-params="queryParams" @ok="handleQuery"></more-query>

  </div>
</template>

<script>
import {listQsLed, signReceivingLed} from "@/api/order/led";
import {listOrderTrackByOrderId} from "@/api/order/orderTrack";
import MoreQuery from "@/views/order/led/component/moreQuery.vue";
import MultipleSelect from "@/components/MultipleSelect/index.vue";

export default {
  name: "SignIndex",
  components: {MultipleSelect, MoreQuery},
  dicts: ['OrderStatus', 'CommIsNot', 'TransportPro', 'HandoverType', 'DB_JC_ORG'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      codes: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 分段订单表格数据
      ledList: [],
      detailForm: {},
      openDetail: false,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        code: null,
        name: null,
        status: null,
        isSign: null,
        backNumber: null,
        customerIsExceed: null,
        customerName: null,
        customerType: null,
        factArriveTime: null,
        factLeaveTime: null,
        feeType: null,
        handoverType: null,
        isAbnormal: null,
        isBack: null,
        number: null,
        actNumber: null,
        orderMileage: null,
        planArriveTime: null,
        planLeaveTime: null,
        relateBill1: null,
        relateBill2: null,
        relateBill3: null,
        relateBill4: null,
        relateBill5: null,
        salePerson: null,
        shipmentMethod: null,
        time: null,
        transportPro: null,
        value: null,
        volume: null,
        weight: null,
        jcCustomerId: null,
        jcEndZoneId: null,
        jcOrderId: null,
        jcOrganizationId: null,
        jcPrescoId: null,
        jcDispatchId: null,
        jcStartZoneId: null,
        jcToOrganizationId: null,
        routerOrgIds: null,
        jcZoneStoreroomId: null,
        type: null,
        agent: null,
        qsTime: null,
        qsPerson: null,
        qsImgs: null,
        jzWeight: null,
        arrivePay: null,
        jcShipmentId: null,
        // 计划发运时间
        daterangePlanLeaveTime: [],
        // 运单ID时间范围
        daterangeCreateTime: [],
        // 运单ID时间范围
        daterangeModifyTime: [],
        // 运单ID时间范围
        daterangeFactArriveTime: [],
        // 运单ID时间范围
        daterangeFactLeaveTime: [],
        // 运单ID时间范围
        daterangeTime: [],
        // 运单ID时间范围
        daterangeQsTime: [],
        receivingPerson: null
      },
      // 表单参数
      qsForm: {},
      // 表单校验
      rules: {
        qsImgs: [
          {required: true, message: "签收图片", trigger: "blur"}
        ],
      },
      orderTrackList: [],
      orderTrackVisible: false,
      openPicVisible: false,
      openPicList: []
    };
  },
  computed: {
    tableMaxHeight() {
      let tableHeight = 0;
      let tableH = 210; //距离页面下方的高度
      let tableHeightDetil = window.innerHeight - tableH;
      if (tableHeightDetil <= 300) {
        tableHeight = 300;
      } else {
        tableHeight = window.innerHeight - tableH;
      }
      return tableHeight;
    }
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询分段订单列表 */
    getList() {
      this.loading = true;
      this.queryParams.params = {};
      if (null != this.queryParams.daterangePlanLeaveTime && '' !== this.queryParams.daterangePlanLeaveTime) {
        this.queryParams.params["beginPlanLeaveTime"] = this.queryParams.daterangePlanLeaveTime[0];
        this.queryParams.params["endPlanLeaveTime"] = this.queryParams.daterangePlanLeaveTime[1];
      }
      if (null != this.queryParams.daterangeCreateTime && '' !== this.queryParams.daterangeCreateTime) {
        this.queryParams.params["beginCreateTime"] = this.queryParams.daterangeCreateTime[0];
        this.queryParams.params["endCreateTime"] = this.queryParams.daterangeCreateTime[1];
      }
      if (null != this.queryParams.daterangeModifyTime && '' !== this.queryParams.daterangeModifyTime) {
        this.queryParams.params["beginModifyTime"] = this.queryParams.daterangeModifyTime[0];
        this.queryParams.params["endModifyTime"] = this.queryParams.daterangeModifyTime[1];
      }
      if (null != this.queryParams.daterangeFactArriveTime && '' !== this.queryParams.daterangeFactArriveTime) {
        this.queryParams.params["beginFactArriveTime"] = this.queryParams.daterangeFactArriveTime[0];
        this.queryParams.params["endFactArriveTime"] = this.queryParams.daterangeFactArriveTime[1];
      }
      if (null != this.queryParams.daterangeFactLeaveTime && '' !== this.queryParams.daterangeFactLeaveTime) {
        this.queryParams.params["beginFactLeaveTime"] = this.queryParams.daterangeFactLeaveTime[0];
        this.queryParams.params["endFactLeaveTime"] = this.queryParams.daterangeFactLeaveTime[1];
      }
      if (null != this.queryParams.daterangeTime && '' !== this.queryParams.daterangeTime) {
        this.queryParams.params["beginTime"] = this.queryParams.daterangeTime[0];
        this.queryParams.params["endTime"] = this.queryParams.daterangeTime[1];
      }
      if (null != this.queryParams.daterangeQsTime && '' !== this.queryParams.daterangeQsTime) {
        this.queryParams.params["beginQsTime"] = this.queryParams.daterangeQsTime[0];
        this.queryParams.params["endQsTime"] = this.queryParams.daterangeQsTime[1];
      }
      listQsLed(this.queryParams).then(response => {
        this.ledList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.qsForm = {
        qsImgs: null,
        ledCodes: null,
        ledIds: null
      };
      this.resetForm("qsForm");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams.daterangePlanLeaveTime = [];
      this.queryParams.daterangeCreateTime = [];
      this.queryParams.daterangeModifyTime = [];
      this.queryParams.daterangeFactArriveTime = [];
      this.queryParams.daterangeFactLeaveTime = [];
      this.queryParams.daterangeTime = [];
      this.queryParams.daterangeQsTime = [];
      this.resetForm("queryForm");
      this.$refs.moreQuery.resetQuery();
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.codes = selection.map(item => item.code)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleSign(row) {
      this.reset();
      const ids = row.id || this.ids
      const codes = row.code || this.codes
      this.open = true;
      this.qsForm.ledCodes = codes
      if (row.code) {
        this.qsForm.codes = codes
        this.qsForm.ledId = ids
      } else {
        this.qsForm.ledIds = ids
        this.qsForm.codes = codes.join(',')
      }
      this.title = "签收分段订单";
    },
    handleDetail(row) {
      this.openDetail = true
      this.detailForm = row
      console.log(row)
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["qsForm"].validate(valid => {
        if (valid) {
          signReceivingLed(this.qsForm).then(response => {
            this.$modal.msgSuccess("签收成功");
            this.open = false;
            this.getList();
          });
        }
      });
    },
    openTrack(row) {
      this.orderTrackVisible = true
      this.orderTrackList = []
      /** 查询订单追踪列表 */
      this.loading = true;
      listOrderTrackByOrderId(row.orderId).then(response => {
        this.loading = false;
        this.orderTrackList = response.data;
        // 处理图片地址
        if (this.orderTrackList.length > 0) {
          this.orderTrackList.forEach(item => {
            if (item.imgs) {
              // 每个图片地址都加上baseUrl
              item.imgUrls = item.imgs.split(',').map(d => process.env.VUE_APP_BASE_API + d)
            }
          })
          debugger
        }
      });
    },
    openPic(row) {
      this.openPicVisible = true
      this.openPicList = []
      if (row.qsImgs) {
        this.openPicList = row.qsImgs.split(',').map(d => process.env.VUE_APP_BASE_API + d)
      }
    },
    moreFilterQuery() {
      this.$refs.moreQuery.moreFilterQuery();
    },
  }
};
</script>
